/**
 * @(#)VelocityServiceUtil.java 2011-10-8
 * 
 * Copyright 2000-2011 by ChinanetCenter Corporation.
 *
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * ChinanetCenter Corporation ("Confidential Information").  You
 * shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement
 * you entered into with ChinanetCenter.
 * 
 */

package com.szf.util;

import java.io.Writer;
import java.util.Map;

import com.szf.base.service.SpringContextHolder;
import com.szf.base.service.VelocityService;

/**
 * velocity util class for velocityService。静态方法便于调用。
 * 
 * @author 刘圳
 * @version 1.0 2011-10-8
 * @since 2.0
 */
@SuppressWarnings("rawtypes")
public class VelocityServiceUtil {

	private static VelocityService service;

	static {
		service = SpringContextHolder.getBean(VelocityService.class);
	}

	public static void mergeTemplate(String templateFile, Map model, Writer writer) {
		service.mergeTemplate(templateFile, model, writer);
	}

	public static String mergeTemplateIntoString(String templateFile, Map model) {
		return service.mergeTemplateIntoString(templateFile, model);
	}

	public static void mergeContent(String inContent, Map model, Writer writer) {
		service.mergeContent(inContent, model, writer);
	}

	public static String mergeContentIntoString(String inContent, Map model) {
		return service.mergeContentIntoString(inContent, model);
	}
}
